<!-- 已投简历 -->
<template>
    <div class="page-box h100 display-flex czbj">
      <p class="title-label mb10"  v-if="jkfddsf">已投简历</p>
      <dxtable
        :dataJson="dataJson"
        :portUrl="portUrl"
        :formJson="formJson"
        :qx="qx"
        ref="databale"
      ></dxtable>
    </div>
  </template>
  <script lang="ts" setup>
  import dxtable from "../../components/util/dxtable.vue";
  import sort from "../../components/util/sort.vue";
  import { dxget, dxpost,qurl } from "../../util/index";
  import { NButton, NImage, NTag } from "naive-ui";
  import { h, ref, reactive, render } from "vue";
  const databale = ref();
  const xmlxSelect = ref([])
  const cz = qurl()
  const jkfddsf =ref(true)
  const initeer = () => {
    databale.value.initDataExpose();
  };
  const props = defineProps({
    zwname: {
    type: String,
    default: '',
  }
});
  let dataJson = [
    {
      title: "职位名称",
      key: "zwname",
      search: true,
    },{
      title: "投递人姓名",
      key: "userName",
    },{
      title: "简历",
      render(row){
        return h('span',{class:"ls sz",onClick:()=>{
            open(row.jianli)
        }},row.jianliname)
      }
    },
    {
      title: "添加时间",
      key: "addTime",
      width: 150,
    },
  ];
  
  let qx = {
    DeletePermissionID: "cbrcgongsidel", //删除
    EditPermissionIdentifier: "23456", // 编辑
    NewPermissionIdentifier: "23456", // 新建
    ViewPermissionID: "cbrcgongsick3333", // 查看
  };
  let portUrl = "cbrc/touti/touti";
  if(props.zwname){
    portUrl = "cbrc/touti/touti?zwname="+props.zwname
    jkfddsf.value = false
    qx = {
    DeletePermissionID: "cbrcgongsidel", //删除
    EditPermissionIdentifier: "23456", // 编辑
    NewPermissionIdentifier: "23456", // 新建
    ViewPermissionID: "23456", // 查看
  };
  dataJson[0].search = false
  }
  
  let formJson = reactive([
    {
      title: "公司名称",
      type: "input",
      val: "",
      icon: "dx-shurukuang",
      span: 24,
      key: "name",
      width: "",
      search: false,
      istable: true,
      required: true,
    },
    {
      title: "logo",
      type: "img",
      val: "",
      icon: "dx-img",
      span: 12,
      key: "logo",
      width: "",
      search: false,
      istable: true,
      required: false,
    },{
      title: "公司规模",
      type: "select",
      icon: "dx-biaodanzujian-xialakuang",
      options: [],
      val: "",
      span: 12,
      key: "gsgm",
      width: 0,
      search: false,
      istable: true,
      required: false,
    },
    {
      title: "公司性质",
      type: "input",
      val: "",
      icon: "dx-shurukuang",
      span: 12,
      key: "gsxz",
      width: "",
      search: false,
      istable: true,
      required: false,
    },
    {
      title: "行业",
      type: "input",
      val: "",
      icon: "dx-shurukuang",
      span: 12,
      key: "hangye",
      width: "",
      search: false,
      istable: true,
      required: false,
    },
    {
      title: "简介",
      type: "textarea",
      val: "",
      icon: "dx-duohangwenben",
      span: 24,
      key: "jianjie",
      width: "",
      search: false,
      istable: true,
      required: true,
    }
    
  ]);
  const czFun = {
    fun: (row) => {
      return [
        h(
          NButton,
          {
            type: "info",
            quaternary: true,
            onClick: async (e) => {},
          },
          "复制代码"
        ),
      ];
    },
  };
  
  // 获取字典内容
  const xtgxxmfl = async () => {
    const { data }: any = await dxget("dxgjAdmin/getzd", { name: 'cbrcgsgm' })
    dataJson[2].options = [
      {
        label: "全部",
        value: ""
      },
      ...data
    ]
    formJson[2].options = data
    xmlxSelect.value = data
    console.log(data);
  }
  xtgxxmfl()
  </script>
  <style scoped></style>
  